The field of digital data compression and in particular digital video compression has attracted great interest for some time. In digital video compression, many techniques have been proposed and utilised to compress video information. Particular emphasis has been placed on techniques that provide an attractive balance between high compression and low distortion of the video information.
Compression of a video sequence, by a typical video encoder, generally involves the derivation of a set of syntax elements that describe the video sequence, and consequential entropy encoding of those syntax elements into an encoded bitstream. The set of syntax elements typically comprises flags, numeric values, such as residual coefficients, and a variety of other parameters. Entropy encoding methods can be tailored to suit each type of syntax element to result in a more efficiently encoded video sequence.
A known method of entropy encoding a binary flag exists whereby the flag is encoded into a video bitstream by embedding the value of the flag into a set of the residual coefficients with a frame of a video sequence. In this method, the video encoder indicates the value of the binary flag to the video decoder through the parity bit of the sum of the residual coefficients. This method of encoding a binary flag has advantages over the more basic method of adding the flag information as a new syntax element in the bitstream. The embedding method does not explicitly increase the size of the bitstream through the addition of a new syntax element.
If the natural parity of the sum of the residual coefficients correctly indicates the value of the binary flag to be encoded, the above method will not increase the size of the bitstream, or cause a distortion of the encoded video sequence. However, if the natural parity of the sum of the residual coefficients is inverse to the value of the binary flag, then there is a need to manipulate one or more of the residual coefficients such that the manipulated parity matches the value of the binary flag to be encoded.
The embedding of the binary flag occurs just prior to the encoding of the residual coefficients into the bitstream. In a typical video encoder pipeline, the entropy encoding of residual coefficients occurs after the optimal value of the residual coefficients has been determined, so as to optimise the rate/distortion function. The values of the residual coefficients are quantised such that their values represent an optimal balance between bitstream size and the quality of the encoded video sequence, as measured by peak signal to noise ratio.
Any manipulation of the residual coefficient values will degrade the values away from the optimal rate/distortion balance. This degradation could present itself as an increase in the bitstream size for the encoded video sequence, or a decrease in the quality of the encoded video sequence, as measured by peak signal to noise ratio. Either outcome is undesirable.
Irrespective of the expected distribution of the two possible values of the binary flag to be encoded, the parity bit of the sum of the residual coefficients will need to be manipulated away from its natural state in fifty percent of instances.
It is therefore desirable to minimise the number of instances in which the syntax elements are manipulated and the extent to which they are manipulated in order to embed the video parameter in the video data. A reduction the number of manipulations is desired to minimise the degradation of the optimum rate distortion.